<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">

	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<title>招生详情</title>
	<link rel="stylesheet" href="css/main.css">
	<link rel="stylesheet" href="css/school_news_detalis.css">
	<style>
		.button {
			width: 90%;
			color: #fff;
			background: #8e84ff;
			height: 40px;
			font-size: 25px;
			border-radius: 10px;
			letter-spacing: 10px;
			text-align: center;
			line-height: 40px;
			margin-left: 5%;
			margin-bottom: 20px
		}
	</style>
</head>

<body>
	<div id="container">
		<div class="contain" id="vue-root">
			<div class="header">
				<div class="header_title">招生详情</div>
				<a onclick="history.back()">
					<img src="image/return.png" alt="" class="return">
				</a>
			</div>
			<div class="news_list header-after">
				<div class="news_info">
					<div class="title" v-text="enrollment.name"></div>
					<div class="time" v-text="format(enrollment.time)" style="float: none; margin-bottom: 5px;"></div>
					<div class="img_box" v-if="enrollment.pic">
						<img :src="getImg(enrollment.pic)" class="news_img">
					</div>
					<div class="img_box" v-if="enrollment.video">
						<video :src="getImg(enrollment.video)" class="news_img" autoplay controls playsinline
							webkit-playsinline></video>
					</div>
					<div class="introduce">
						<div class="introduce_container" v-text="enrollment.intro" style="white-space: pre-wrap;"></div>
					</div>
				</div>
			</div>
			<a :href="'signup.html?id='+enrollment.schoolId">
				<div class="button">在线报名</div>
			</a>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/scriptZIP/dayjs.min.js"></script>

	<script src="/js/common.js"></script>

	<script>
		var app = new Vue({
			el: '#vue-root',
			data: {
				enrollment: {},
			},
			created: function () {
				axios.get('/api/enrollment/' + params().id).then(function (res) {
					this.enrollment = res.data;
				}.bind(this));
			},
			methods: {
				getImg: function (pic) {
					return '/static/' + this.enrollment.schoolId + '/enrollment/' + pic;
				},
				format: function (time) {
					return dayjs(time).format('YYYY-MM-DD HH:mm:ss');
				}
			}
		});
	</script>

</body>

</html>